<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="main" style="width: 600px; height: 400px"></div>
  </body>
  <script src="./lib/echarts.min.js"></script>
  <script>
    var chartDom = document.getElementById("main");
    var myChart = echarts.init(chartDom);
    var option;

    option = {
      title: {
        text: "班级每组薪资",
      },
      color: [
        {
          type: "linear",
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [
            {
              offset: 0,
              color: "rgba(81, 217, 168,1)", // 0% 处的颜色
            },
            {
              offset: 1,
              color: "rgba(81, 217, 168,0)", // 100% 处的颜色
            },
          ],
          global: false, // 缺省为 false
        },
        {
          type: "linear",
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [
            {
              offset: 0,
              color: "rgba(73, 159, 238,1)", // 0% 处的颜色
            },
            {
              offset: 1,
              color: "rgba(73, 159, 238,0)", // 100% 处的颜色
            },
          ],
          global: false, // 缺省为 false
        },
      ],
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        axisLine: {
          show: true,
          lineStyle: {
            type: "dashed",
          },
        },
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [120, 60, 150, 80, 70, 110, 130],
          type: "bar",
        },
        {
          data: [70, 50, 130, 20, 34, 120, 77],
          type: "bar",
        },
      ],
    };

    option && myChart.setOption(option);
  </script>
</html>
